
		
//提交报名信息
$('#signBtn').click(function(){
	//alert('活动尚未开始！'); return false;
	
	$.ajax({
		url: 'http://www.ikazs.com/halu-web/act/register',
		data: $('#signForm').serialize(),
		type: 'POST',
		beforeSend: function(){
			if($('#realName').val() === ''){
				return false;
			}
			if($('#phone').val() === ''){
				return false;
			}
		},
		success: function(ret){
			console.info(ret);
			if(ret.success){
				alert('恭喜，领取成功！');
			}else{
				if(ret.message != null){
					alert(ret.message);
				}else{
					alert('报名失败！');
				}
			}
			
		}
	});
});
		
		
wx.ready(function(){
	var _title = "3周年活动暨迎大放价，全屋定制!";
	var _desc = DESC ? DESC : "风格多样，设计免费。收纳扩容，一家搞定。现在报名，全屋定制！300个名额递减中，手慢无！";
	var _link = LINK ? LINK : "http://www.ikazs.com/wx/v1.html";
	var _imgUrl = "http://www.ikazs.com/img/logo.jpg";

	//分享给好友
    wx.onMenuShareAppMessage({
        title: _title,
        desc: _desc,
        link: _link,
        imgUrl: _imgUrl,
        type: 'link', // 分享类型,music、video或link，不填默认为link
        dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        success: function () {
            // 用户确认分享后执行的回调函数
        },
        cancel: function () {
            // 用户取消分享后执行的回调函数
        }
    });

    //分享到朋友圈
    wx.onMenuShareTimeline({
        title: _title,
        desc: _desc,
        link: _link,
        imgUrl: _imgUrl,
        trigger: function (res) {
            // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回.
        },
        success: function (res) {
        },
        cancel: function (res) {
        },
        fail: function (res) {
        }
	});

    //分享到QQ
    wx.onMenuShareQQ({
	    title: _title,
	    desc: _desc,
	    link: _link,
	    imgUrl: _imgUrl,
	    trigger: function (res) {
	    },
	    complete: function (res) {
	    },
	    success: function (res) {
	    },
	    cancel: function (res) {
	    },
	    fail: function (res) {
	    }
    });
  
    wx.error(function (res) {
        alert(res.errMsg);
    });

});
		
function doDraw() {
	_width = window.innerWidth;
	_height = window.innerHeight - 20;
	for(var i = 0, len = imglist.length; i < len; i++) {
		DrawImage(imglist[i], _width, _height);
	}
}

function DrawImage(ImgD, _width, _height) {
	var image = new Image();
	image.src = ImgD.src;
	image.onload = function() {
		if(image.width > 30 && image.height > 30) {

			if(image.width / image.height >= _width / _height) {
				if(image.width > _width) {
					ImgD.width = _width;
					ImgD.height = (image.height * _width) / image.width;
				} else {
					ImgD.width = image.width;
					ImgD.height = image.height;
				}
			} else {
				if(image.height > _height) {
					ImgD.height = _height;
					ImgD.width = (image.width * _height) / image.height;
				} else {
					ImgD.width = image.width;
					ImgD.height = image.height;
				}
			}
		}
	}
}